1. Field of the Invention
The present invention relates to an image processing apparatus, image capturing apparatus, and method of controlling the same.
2. Description of the Related Art
There is known a function of, when reproducing (displaying) an image captured by an image capturing apparatus on an image processing apparatus (image processing application software), displaying distance measuring frames (to be referred to as “AF frames” hereinafter) used for auto focus (AF) at the time of image capturing. For example, Japanese Patent Laid-Open No. 2000-125178 proposes a technique of recording, in an image (image data), the position information of an AF frame (to be referred to as an “in-focus AF frame” hereinafter) used to bring an object into focus and displaying the in-focus AF frame at the time of image reproduction to facilitate confirming image focus. This technique also allows to automatically enlarge the image in the in-focus AF frame.
On the other hand, an image captured by the image capturing apparatus sometimes tilts in the horizontal direction due to the influence of the posture of the image capturing apparatus. Rotation processing of rotating the captured image to correct the tilt has been proposed as one of image processes.
However, when the image is rotated, and the in-focus AF frame is displayed directly using the position information of the AF frame recorded in the image, the in-focus AF frame is displayed in the rotated image at a position shifted from the actual in-focus AF frame position.
The problem of the prior art will be described in detail with reference to FIGS. 5A and 5B. FIG. 5A is a view showing a display example in which an in-focus AF frame is displayed in an image IM1 (that is, an image before rotation processing) that tilts in the horizontal direction. Referring to FIG. 5A, nine rectangular frames represent AF frames FL1 selectable at the time of image capturing. Out of the nine rectangular frames, a rectangular frame indicated by a bold line represents an in-focus AF frame FL2 used to focus on (the face of) an object OB by the AF function.
FIG. 5B is a view showing a display example in which the in-focus AF frame is displayed in an image IM2 obtained by performing rotation processing for the image IM1 shown in FIG. 5A so as to set the object OB in a horizontal position. Referring to FIG. 5B, an image IM3 is obtained by cutting out, from the image IM2 after the rotation processing, a region inscribed in the image region of the image IM2 not to include any image region absent in the image IM1 before the rotation processing. The position of the object OB in the image IM2 that has undergone the rotation processing is shifted from its position in the image IM1 before the rotation processing. The AF frames FL1 and the in-focus AF frame FL2 are displayed in the image IM3 using position information cut out upon cutting out the image IM3 from the image IM2.
As described above, when the AF frames FL1 and the in-focus AF frame FL2 are displayed in the image IM3 directly using the position information recorded in the image IM1, the in-focus AF frame FL2 is displayed at a position shifted from the position of the face of the object OB (actual in-focus AF frame position) in the image IM3.